<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>navigator.share</title>
</head>

<body>
    <!-- 没啥卵用 -->
    <button id="btn">点我分享</button>
    <script>
        document.getElementById('btn').addEventListener('click', () => {
            navigator.share({
                title: document.title,
                text: "Hello World",
                url: "https://developer.mozilla.org",
            }); // 分享 MDN 的 URL
        })
    </script>
</body>

</html>